package com.foreknow.service.impl;

import com.foreknow.bean.User;
import com.foreknow.dao.UserDao;
import com.foreknow.dao.impl.UserDaoImpl;
import com.foreknow.service.UserService;

public class UserServiceImpl implements UserService {
    private UserDao userDao;
//get/set方法
    public UserDao getUserDao() {
        return userDao;
    }

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }
//构造器
//    public UserServiceImpl(){
//        userDao = new UserDaoImpl();
//    }
    @Override
    public boolean save(User user) {
        //创建一个持久层的方法
        boolean isRight = userDao.addUser(user);
        return isRight;
    }
}
